package org.admanager.mapping.plugin.diagram.navigator;

import org.admanager.mapping.plugin.diagram.edit.parts.ComponentEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentReferenceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentReferenceMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentReferenceMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentReferenceMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentServiceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentServiceMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentServiceMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ComponentServiceMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.CompositeEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.CompositeMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.CompositeMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.CompositeMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.CompositeNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.DocumentRootEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.DocumentRootNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponent2EditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentName2EditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentReference2EditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentReferenceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentService2EditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PComponentServiceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PCompositeEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PCompositeNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PReferenceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PServiceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PatternEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.PatternNameEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ReferenceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ReferenceMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ReferenceMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ReferenceMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.RootMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ServiceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ServiceMappingEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ServiceMappingSourceEditPart;
import org.admanager.mapping.plugin.diagram.edit.parts.ServiceMappingTargetEditPart;
import org.admanager.mapping.plugin.diagram.part.SOADManagementMetamodelDiagramEditorPlugin;
import org.admanager.mapping.plugin.diagram.part.SOADManagementMetamodelVisualIDRegistry;
import org.admanager.mapping.plugin.diagram.providers.SOADManagementMetamodelElementTypes;
import org.admanager.mapping.plugin.diagram.providers.SOADManagementMetamodelParserProvider;
import org.admanager.soadmanagement.plugin.soadmanagement.ComponentReference;
import org.admanager.soadmanagement.plugin.soadmanagement.ComponentService;
import org.admanager.soadmanagement.plugin.soadmanagement.PComponentReference;
import org.admanager.soadmanagement.plugin.soadmanagement.PComponentService;
import org.admanager.soadmanagement.plugin.soadmanagement.PReference;
import org.admanager.soadmanagement.plugin.soadmanagement.PService;
import org.admanager.soadmanagement.plugin.soadmanagement.Reference;
import org.admanager.soadmanagement.plugin.soadmanagement.Service;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

/**
 * @generated
 */
public class SOADManagementMetamodelNavigatorLabelProvider extends
		LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		SOADManagementMetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		SOADManagementMetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof SOADManagementMetamodelNavigatorItem
				&& !isOwnView(((SOADManagementMetamodelNavigatorItem) element)
						.getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof SOADManagementMetamodelNavigatorGroup) {
			SOADManagementMetamodelNavigatorGroup group = (SOADManagementMetamodelNavigatorGroup) element;
			return SOADManagementMetamodelDiagramEditorPlugin.getInstance()
					.getBundledImage(group.getIcon());
		}

		if (element instanceof SOADManagementMetamodelNavigatorItem) {
			SOADManagementMetamodelNavigatorItem navigatorItem = (SOADManagementMetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getImage(view);
			}
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (SOADManagementMetamodelVisualIDRegistry.getVisualID(view)) {
		case PServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PService", SOADManagementMetamodelElementTypes.PService_3024); //$NON-NLS-1$
		case ReferenceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ReferenceMapping?target", SOADManagementMetamodelElementTypes.ReferenceMappingTarget_4016); //$NON-NLS-1$
		case CompositeMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?CompositeMapping", SOADManagementMetamodelElementTypes.CompositeMapping_2012); //$NON-NLS-1$
		case ServiceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ServiceMapping?source", SOADManagementMetamodelElementTypes.ServiceMappingSource_4014); //$NON-NLS-1$
		case ComponentReferenceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentReferenceMapping?source", SOADManagementMetamodelElementTypes.ComponentReferenceMappingSource_4022); //$NON-NLS-1$
		case ServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Service", SOADManagementMetamodelElementTypes.Service_3014); //$NON-NLS-1$
		case PComponentServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponentService", SOADManagementMetamodelElementTypes.PComponentService_3018); //$NON-NLS-1$
		case RootMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://soageneralpattern/1.0?RootMapping", SOADManagementMetamodelElementTypes.RootMapping_1000); //$NON-NLS-1$
		case PCompositeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComposite", SOADManagementMetamodelElementTypes.PComposite_3020); //$NON-NLS-1$
		case ComponentServiceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentServiceMapping?source", SOADManagementMetamodelElementTypes.ComponentServiceMappingSource_4020); //$NON-NLS-1$
		case ComponentServiceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?ComponentServiceMapping", SOADManagementMetamodelElementTypes.ComponentServiceMapping_2011); //$NON-NLS-1$
		case ComponentReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentReference", SOADManagementMetamodelElementTypes.ComponentReference_3009); //$NON-NLS-1$
		case CompositeMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?CompositeMapping?target", SOADManagementMetamodelElementTypes.CompositeMappingTarget_4013); //$NON-NLS-1$
		case PComponentReference2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponentReference", SOADManagementMetamodelElementTypes.PComponentReference_3023); //$NON-NLS-1$
		case PComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponent", SOADManagementMetamodelElementTypes.PComponent_3017); //$NON-NLS-1$
		case DocumentRootEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?DocumentRoot", SOADManagementMetamodelElementTypes.DocumentRoot_2016); //$NON-NLS-1$
		case PComponent2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponent", SOADManagementMetamodelElementTypes.PComponent_3021); //$NON-NLS-1$
		case CompositeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Composite", SOADManagementMetamodelElementTypes.Composite_3016); //$NON-NLS-1$
		case ComponentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Component", SOADManagementMetamodelElementTypes.Component_3011); //$NON-NLS-1$
		case ServiceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?ServiceMapping", SOADManagementMetamodelElementTypes.ServiceMapping_2014); //$NON-NLS-1$
		case ComponentServiceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentServiceMapping?target", SOADManagementMetamodelElementTypes.ComponentServiceMappingTarget_4024); //$NON-NLS-1$
		case CompositeMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?CompositeMapping?source", SOADManagementMetamodelElementTypes.CompositeMappingSource_4023); //$NON-NLS-1$
		case ReferenceMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ReferenceMapping?source", SOADManagementMetamodelElementTypes.ReferenceMappingSource_4017); //$NON-NLS-1$
		case ServiceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ServiceMapping?target", SOADManagementMetamodelElementTypes.ServiceMappingTarget_4015); //$NON-NLS-1$
		case ReferenceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?ReferenceMapping", SOADManagementMetamodelElementTypes.ReferenceMapping_2015); //$NON-NLS-1$
		case ComponentMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?ComponentMapping", SOADManagementMetamodelElementTypes.ComponentMapping_2013); //$NON-NLS-1$
		case PComponentReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponentReference", SOADManagementMetamodelElementTypes.PComponentReference_3019); //$NON-NLS-1$
		case ComponentServiceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?ComponentService", SOADManagementMetamodelElementTypes.ComponentService_3008); //$NON-NLS-1$
		case ReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?Reference", SOADManagementMetamodelElementTypes.Reference_3015); //$NON-NLS-1$
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentMapping?target", SOADManagementMetamodelElementTypes.ComponentMappingTarget_4018); //$NON-NLS-1$
		case PatternEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?Pattern", SOADManagementMetamodelElementTypes.Pattern_2017); //$NON-NLS-1$
		case PReferenceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PReference", SOADManagementMetamodelElementTypes.PReference_3025); //$NON-NLS-1$
		case ComponentReferenceMappingTargetEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentReferenceMapping?target", SOADManagementMetamodelElementTypes.ComponentReferenceMappingTarget_4021); //$NON-NLS-1$
		case ComponentReferenceMappingEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://soageneralpattern/1.0?ComponentReferenceMapping", SOADManagementMetamodelElementTypes.ComponentReferenceMapping_2010); //$NON-NLS-1$
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://soageneralpattern/1.0?ComponentMapping?source", SOADManagementMetamodelElementTypes.ComponentMappingSource_4019); //$NON-NLS-1$
		case PComponentService2EditPart.VISUAL_ID:
			return getImage(
					"Navigator?Node?http://soageneralpattern/1.0?PComponentService", SOADManagementMetamodelElementTypes.PComponentService_3022); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = SOADManagementMetamodelDiagramEditorPlugin
				.getInstance().getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null
				&& elementType != null
				&& SOADManagementMetamodelElementTypes
						.isKnownElementType(elementType)) {
			image = SOADManagementMetamodelElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof SOADManagementMetamodelNavigatorGroup) {
			SOADManagementMetamodelNavigatorGroup group = (SOADManagementMetamodelNavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof SOADManagementMetamodelNavigatorItem) {
			SOADManagementMetamodelNavigatorItem navigatorItem = (SOADManagementMetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		// Due to plugin.xml content will be called only for "own" views
		if (element instanceof IAdaptable) {
			View view = (View) ((IAdaptable) element).getAdapter(View.class);
			if (view != null && isOwnView(view)) {
				return getText(view);
			}
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (SOADManagementMetamodelVisualIDRegistry.getVisualID(view)) {
		case PServiceEditPart.VISUAL_ID:
			return getPService_3024Text(view);
		case ReferenceMappingTargetEditPart.VISUAL_ID:
			return getReferenceMappingTarget_4016Text(view);
		case CompositeMappingEditPart.VISUAL_ID:
			return getCompositeMapping_2012Text(view);
		case ServiceMappingSourceEditPart.VISUAL_ID:
			return getServiceMappingSource_4014Text(view);
		case ComponentReferenceMappingSourceEditPart.VISUAL_ID:
			return getComponentReferenceMappingSource_4022Text(view);
		case ServiceEditPart.VISUAL_ID:
			return getService_3014Text(view);
		case PComponentServiceEditPart.VISUAL_ID:
			return getPComponentService_3018Text(view);
		case RootMappingEditPart.VISUAL_ID:
			return getRootMapping_1000Text(view);
		case PCompositeEditPart.VISUAL_ID:
			return getPComposite_3020Text(view);
		case ComponentServiceMappingSourceEditPart.VISUAL_ID:
			return getComponentServiceMappingSource_4020Text(view);
		case ComponentServiceMappingEditPart.VISUAL_ID:
			return getComponentServiceMapping_2011Text(view);
		case ComponentReferenceEditPart.VISUAL_ID:
			return getComponentReference_3009Text(view);
		case CompositeMappingTargetEditPart.VISUAL_ID:
			return getCompositeMappingTarget_4013Text(view);
		case PComponentReference2EditPart.VISUAL_ID:
			return getPComponentReference_3023Text(view);
		case PComponentEditPart.VISUAL_ID:
			return getPComponent_3017Text(view);
		case DocumentRootEditPart.VISUAL_ID:
			return getDocumentRoot_2016Text(view);
		case PComponent2EditPart.VISUAL_ID:
			return getPComponent_3021Text(view);
		case CompositeEditPart.VISUAL_ID:
			return getComposite_3016Text(view);
		case ComponentEditPart.VISUAL_ID:
			return getComponent_3011Text(view);
		case ServiceMappingEditPart.VISUAL_ID:
			return getServiceMapping_2014Text(view);
		case ComponentServiceMappingTargetEditPart.VISUAL_ID:
			return getComponentServiceMappingTarget_4024Text(view);
		case CompositeMappingSourceEditPart.VISUAL_ID:
			return getCompositeMappingSource_4023Text(view);
		case ReferenceMappingSourceEditPart.VISUAL_ID:
			return getReferenceMappingSource_4017Text(view);
		case ServiceMappingTargetEditPart.VISUAL_ID:
			return getServiceMappingTarget_4015Text(view);
		case ReferenceMappingEditPart.VISUAL_ID:
			return getReferenceMapping_2015Text(view);
		case ComponentMappingEditPart.VISUAL_ID:
			return getComponentMapping_2013Text(view);
		case PComponentReferenceEditPart.VISUAL_ID:
			return getPComponentReference_3019Text(view);
		case ComponentServiceEditPart.VISUAL_ID:
			return getComponentService_3008Text(view);
		case ReferenceEditPart.VISUAL_ID:
			return getReference_3015Text(view);
		case ComponentMappingTargetEditPart.VISUAL_ID:
			return getComponentMappingTarget_4018Text(view);
		case PatternEditPart.VISUAL_ID:
			return getPattern_2017Text(view);
		case PReferenceEditPart.VISUAL_ID:
			return getPReference_3025Text(view);
		case ComponentReferenceMappingTargetEditPart.VISUAL_ID:
			return getComponentReferenceMappingTarget_4021Text(view);
		case ComponentReferenceMappingEditPart.VISUAL_ID:
			return getComponentReferenceMapping_2010Text(view);
		case ComponentMappingSourceEditPart.VISUAL_ID:
			return getComponentMappingSource_4019Text(view);
		case PComponentService2EditPart.VISUAL_ID:
			return getPComponentService_3022Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getPService_3024Text(View view) {
		PService domainModelElement = (PService) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3024); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReferenceMappingTarget_4016Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getCompositeMapping_2012Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getServiceMappingSource_4014Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMappingSource_4022Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getService_3014Text(View view) {
		Service domainModelElement = (Service) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3014); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPComponentService_3018Text(View view) {
		PComponentService domainModelElement = (PComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getRootMapping_1000Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComposite_3020Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.PComposite_3020, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(PCompositeNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5022); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMappingSource_4020Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMapping_2011Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReference_3009Text(View view) {
		ComponentReference domainModelElement = (ComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3009); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getCompositeMappingTarget_4013Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComponentReference_3023Text(View view) {
		PComponentReference domainModelElement = (PComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPComponent_3017Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.PComponent_3017, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(PComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5020); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getDocumentRoot_2016Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.DocumentRoot_2016, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(DocumentRootNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5019); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPComponent_3021Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.PComponent_3021, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(PComponentName2EditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5021); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComposite_3016Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.Composite_3016, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(CompositeNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponent_3011Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.Component_3011, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(ComponentNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5013); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getServiceMapping_2014Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentServiceMappingTarget_4024Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getCompositeMappingSource_4023Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getReferenceMappingSource_4017Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getServiceMappingTarget_4015Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getReferenceMapping_2015Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMapping_2013Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComponentReference_3019Text(View view) {
		PComponentReference domainModelElement = (PComponentReference) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3019); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentService_3008Text(View view) {
		ComponentService domainModelElement = (ComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3008); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getReference_3015Text(View view) {
		Reference domainModelElement = (Reference) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3015); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentMappingTarget_4018Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPattern_2017Text(View view) {
		IParser parser = SOADManagementMetamodelParserProvider.getParser(
				SOADManagementMetamodelElementTypes.Pattern_2017, view
						.getElement() != null ? view.getElement() : view,
				SOADManagementMetamodelVisualIDRegistry
						.getType(PatternNameEditPart.VISUAL_ID));
		if (parser != null) {
			return parser.getPrintString(new EObjectAdapter(
					view.getElement() != null ? view.getElement() : view),
					ParserOptions.NONE.intValue());
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 5023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getPReference_3025Text(View view) {
		PReference domainModelElement = (PReference) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3025); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMappingTarget_4021Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentReferenceMapping_2010Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getComponentMappingSource_4019Text(View view) {
		return ""; //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private String getPComponentService_3022Text(View view) {
		PComponentService domainModelElement = (PComponentService) view
				.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getName();
		} else {
			SOADManagementMetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 3022); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$  //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return RootMappingEditPart.MODEL_ID
				.equals(SOADManagementMetamodelVisualIDRegistry
						.getModelID(view));
	}

}
